package com.quectel.core.module.devicepatrol.dto;

import com.quectel.core.module.workorder.dto.WorkOrderDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2022/05/07 14:06
 */
@Data
@Schema
public class DevicePatrolEventReportDto implements Serializable {

    /**
     *
     */
    @Schema(description = "")
    private Long id;

    /**
     *
     */
    @Schema(description = "")
    private Long tenantId;

    /**
     * 所属小区
     */
    @Schema(description = "所属小区")
    @NotNull
    private Long villageId;

    /**
     * 巡更任务id
     */
    @Schema(description = "巡更任务id")
    @NotNull
    private Long taskId;

    /**
     * 任务名称(日期+计划+时间段)
     */
    @Schema(description = "任务名称(日期+计划+时间段)")
    @NotEmpty
    @Length(min = 1, max = 80)
    private String taskName;

    /**
     * 设备
     */
    @Schema(description = "设备")
    @NotNull
    private Long deviceId;

    /**
     * 上报人id
     */
    @Schema(description = "上报人id")
    @NotNull
    private Long reportUserId;

    /**
     * 上报人姓名
     */
    @Schema(description = "上报人姓名")
    @Length(max = 80)
    private String reportUsername;

    /**
     * 抓拍图片
     */
    @Schema(description = "跳检原因字典值")
    private Byte skipCheckReasonType;

    /**
     * 抓拍图片数组
     */
    @Schema(description = "抓拍图片数组")
    private String snapshotImg;

    /**
     * 事件描述
     */
    @Schema(description = "事件描述")
    @NotEmpty
    @Length(min = 1, max = 1000)
    private String detail;

    /**
     * 经度
     */
    @Schema(description = "经度")
    @NotNull
    private Double lng;

    /**
     * 纬度
     */
    @Schema(description = "纬度")
    @NotNull
    private Double lat;

    /**
     * 上报地址
     */
    @Schema(description = "上报地址")
    @NotEmpty
    @Length(min = 1, max = 80)
    private String address;

    /**
     * 状态0异常1正常2跳检
     */
    @Schema(description = "状态0异常1正常2跳检3漏检")
    @NotNull
    private Byte status;

    /**
     * 是否分配工单0否1是
     */
    @Schema(description = "是否分配工单0否1是")
    @NotNull
    private Byte assignWorkOrder;

    /**
     * 工单处理人id
     */
    @Schema(description = "工单处理人id")
    private Long assignUserId;

    /**
     * 工单处理人姓名
     */
    @Schema(description = "工单处理人姓名")
    private String assignUsername;

    /**
     * 工单id
     */
    @Schema(description = "工单id")
    private Long workOrderId;

    /**
     * 工单号
     */
    @Schema(description = "工单号")
    private String workOrderNo;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date completeTime;

    /************非数据库字段 start ************/

    /**
     * 园区名称
     */
    @Schema(description = "园区名称")
    private String villageName;

    /**
     * 设备详情
     */
    @Schema(description = "设备名称")
    private String deviceName;

    /**
     * 设备详情
     */
    @Schema(description = "设备imei")
    private String imei;

    /**
     * 设备详情
     */
    @Schema(description = "设备安装地址")
    private String installAddress;


    /**
     * 工单详情
     */
    @Schema(description = "工单详情")
    private WorkOrderDto workOrderDto;

    /************非数据库字段 end **************/
}
